package br.ufpe.cin.imlm2.util.options;

import java.util.List;
import java.util.Map;

/**
 * Represents a set of {@link Option}s. Any implementation will have to provide
 * a <code>parse(Map&lt;String,String&gt;)</code> method that will be used to
 * update the values of the possible options.
 * 
 * @author Irineu
 */
public interface IOptions {

	public abstract void parse( Map<String, String> options ) throws ParsingException,
			NoSuchOptionException;

	/**
	 * Returns a list with all the possible names of valid (declared) options.
	 * 
	 * @return
	 */
	public abstract List<String> getDeclaredOptions();

	/**
	 * Returns the string representation of the value for the option with name
	 * <code>optName</code>. The string representation must generate an
	 * equivalent value as if it were to be parsed by the
	 * <code>parse(Map<String,String>)</code> method.
	 * 
	 * @param optName
	 *            Option name
	 * @return
	 * @throws NoSuchOptionException
	 *             In case an option with <code>optName</code> doesn't exist.
	 */
	public abstract String getOptionStringValue( String optName ) throws NoSuchOptionException;

	public abstract List<Option> getOptions();

	public abstract boolean addOption( Option op );

	public abstract Option getOption( String optName ) throws NoSuchOptionException;
}
